<!DOCTYPE html>
<meta charset="UTF-8">
<html>
<head>

</head>
<body>

<script type="module">
    "use strict";
    import {member_function_callback} from '../code-snippet/member-func-callback.js';

    member_function_callback();


</script>

<script src="../code-snippet/set-css-header.js"></script>

<script type="module">
    "use strict";

    function testLet() {
        let data = "hello world";
        return data;
    }
    let letData = testLet();
    console.log(letData);

    import {Page} from '../app/Page.js';

    var xml =
        `
    <!--index.wxml-->
            <view class="container">
            <view class="userinfo">
            <button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
            <block wx:else>
            <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover"></image>
            <text class="userinfo-nickname">{{userInfo.nickName}}</text>
            </block>
            </view>

            <view class="usermotto" bindtap="bindViewTap">
            <text class="user-motto">{{motto}}</text>
            </view>
            <view wx:for="{{array}}">
                <view>1:{{item}}</view>
                <view>2:{{item}}</view>
                <view>3:{{item}}</view>
            </view>
            <view wx:if="{{view == 'WEBVIEW'}}"> WEBVIEW </view>
            <view wx:elif="{{view == 'APP'}}"> APP </view>
            <view wx:else="{{view == 'MINA'}}"> MINA </view>
            </view>
            `;


    var data = {
        motto: 'Hello World',
        userInfo: {
            avatarUrl: "hello"
            },
        hasUserInfo: false,
        canIUse: function() {
            return true;
        },
        array: [1, 2, 3, 4, 5],
        view: "MINA",
        staffA: {firstName: 'Hulk', lastName: 'Hu'},
        bindViewTap: function($event) {
            window.setTimeout(()=>{
                this.setData({
                motto: 'hello again'
                });
            }, 3000);
        }
    };

    var page = new Page(
            null,
            data,
            xml,
            null
        );




</script>
<script>
</script>
</body>
</html>